/*
编写 : Hexh
时间 : 2013-4-26 11:50:43
*/
using System.Collections.Generic;
using HMIS.FrameWork.DomainBase;
using HMIS.Infrastructure.Core.Repositories;
using HMIS.Infrastructure.Core.Entities;

namespace HMIS.Infrastructure.Facade.Impl
{
	/// <summary>
	///	 the impl of IInfraMxsqFacade
	/// </summary>
	public class InfraMxsqFacadeImpl : IInfraMxsqFacade
	{

		private readonly IInfraMxsqRepository InfraMxsqRepository;

		public InfraMxsqFacadeImpl(IInfraMxsqRepository InfraMxsqRepository)
		{
			this.InfraMxsqRepository = InfraMxsqRepository;
		}

		#region IInfraMxsq Entity Save,Get,Update,Delete

		public InfraMxsq Get(string id)
		{
			return InfraMxsqRepository.Get(id);
		}

		public InfraMxsq Load(string id)
		{
			return InfraMxsqRepository.Load(id);
		}

		public void SaveOrUpdate(InfraMxsq entity)
		{
			this.InfraMxsqRepository.SaveOrUpdate(entity);
		}

		public void Delete(string id)
		{
			InfraMxsqRepository.Delete(id);
		}

		public void PhysicsDelete(string id)
		{
			InfraMxsqRepository.PhysicsDelete(id);
		}

		public bool IsFieldExist(string fieldName, string fieldValue, string id)
		{
			return InfraMxsqRepository.IsFieldExist(fieldName, fieldValue, id);
		}

		public bool IsFieldExistWhere(string fieldName, string fieldValue, string id, string where)
		{
			return InfraMxsqRepository.IsFieldExistWhere(fieldName, fieldValue, id, where);
		}

		#endregion

		#region Query

		public IList<InfraMxsq> GetAll()
		{
			return InfraMxsqRepository.GetAll();
		}

		public IList<InfraMxsq> GetPlist(string query, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
		{
			return InfraMxsqRepository.GetPlist(query, start, limit, sort, dir, filters, out total);
		}

		public string GetNewId(string sqnocd, string sqnodp, string sqnodt)
		{
			return InfraMxsqRepository.GetNewId(sqnocd, sqnodp, sqnodt);
		}
		#endregion
	}
}
